<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>发布的项目 - 会员中心<Zml:title /></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="__PUBLIC__/css/pintuer.css">
<script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
<script src="__PUBLIC__/js/pintuer.js"></script>
<script src="__PUBLIC__/js/respond.js"></script>
<script src="__LIB__layer/layer.js"></script>
<script src="__LIB__laydate/laydate.js"></script>
<script type="text/javascript" charset="utf-8" src="__LIB__ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__LIB__ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="__LIB__ueditor/lang/zh-cn/zh-cn.js"></script>

</head>
<body style="background:#e7e8eb">
<include file="Home@default/Public/header" />
<include file="./header" />

<div class="x12 padding border-bottom">
	<h1>我发布的项目</h1>
</div>
<div class="x12 text-center padding-top padding-bottom border-bottom border-top margin-top">
	<a href="{:U('Item/index')}" class='x1 <if condition="!$_GET['progress']"> border-right text-red</if>'>全部</a>
	<zmllist name="progresslist" id="zml">
		<a href="{:U('Item/index',array('progress'=>$zml['id']))}"  class="x1 <if condition="$_GET['progress'] eq $zml['id']"> border-right text-red</if>">{$zml.name}</a>
	</zmllist>
</div>
<zmllist name="list" id="zml">
	<div class="x12 bg padding">
		<div class="x3 padding  bg-white"><img src="{$zml.cover_img}" alt="{$zml.name}" class="x12" height="94"></div>
		<div class="x9 bg padding bg-white border-left height-big" style="height: 114px;">
			<div>
				<span class="x6">
					<span class="text-big">{$zml.name}<a class="text-small text-gray" href="{:U('User/Item/item_add',array('itemid'=>$zml['id']))}" class="text-gray"> 修改</a></span>
					<div class="x12 text-gray">
						<div class="x6">
							<span class="x12 text-small">融资总额: <span class="text-red">￥{$zml.raising_money}</span></span>
						</div>
						<div class="x6">
							<span class="x12 text-small">投资方占比: <span class="text-red">{$zml.investment_rate}%</span></span>
						</div>
						<div class="x6">
							<span class="x12 text-small"> 已融资: <span class="text-red"> ￥{$zml.count_money}</span></span>
						</div>
						<div class="x6">
							<span class="x12 text-small">完成率: <span class="text-red">{$zml.success_rate}%</span></span>
						</div>
					</div>
				</span>
				<span class="x6">
					<div class="x9">
						<button class="button radius-none bg-red button-small">{$zml.progress_name}</button>
						<button onClick="lead({$zml.id},this)" class="button button-small radius-none bg-yellow margin-left">领投规则</button>
						<button onclick="video('{:U('User/Item/item_video',array('itemid'=>$zml['id']))}')" class="button button-small radius-none bg-sub margin-left">视频管理</button>
						
					</div>
					<div class="x3">
						<span class="x12"><a href="{:U('Item/interview',array('itemid'=>$zml['id']))}" class="button button-small bg-sub radius-none">{$zml.interview}位约谈</a></span>
						<span class="x12 margin-top"><a href="{:U('Lead/index',array('itemid'=>$zml['id']))}" class="button button-small bg-sub radius-none">{$zml.countlead}位领投</a></span>
					</div>
				</span>
			</div>
		</div>
	</div>
</zmllist>
<div class="x12 text-center padding"><ul class="pagination border-red pagination-small">{$page}</ul></div>
</div>
</div>
</div>
<div class="clearfix"></div>

<include file="Home@default/Public/foot" />
<script>
	function open_l(itemid,info){
		layer.open({
		    type: 1,
		    title:'设置领投规则',
		    skin: 'layui-layer-rim', //加上边框
		    area: ['600px', '450px'], //宽高
		    content: '<form class="form padding-big">'+
		    '<input type="hidden" name="itemid" value="'+itemid+'"/>'+
			'<div class="form-group">'+
				'<div class="label"><label for="manage_money">领投人管理服务费</label></div>'+
				'<div class="field field-icon-right">'+
					'<input type="text" class="input" id="manage_money" name="manage_money" value="'+info.manage_money+'" size="30" placeholder="纯数字" />'+
				'</div>'+
			'</div>'+
			'<div class="form-group">'+
				'<div class="label"><label for="num">领投人数量</label></div>'+
				'<div class="field field-icon-right">'+
					'<input type="text" class="input" id="num" name="num" size="30" value="'+info.num+'" placeholder="纯数字" />'+
				'</div>'+
			'</div>'+
			'<div class="form-group">'+
				'<div class="label"><label for="do_what">领投人义务</label></div>'+
				'<div class="field field-icon-right">'+
					'<textarea type="text" rows="5" class="input" id="do_what" name="do_what"  placeholder="领头人需要做什么">'+info.do_what+'</textarea>'+
				'</div>'+
			'</div>'+
			'<div class="form-button"><button class="button radius-none bg-red" type="button" onClick="sub(this)">提交</button></div>'+
			'</form>'
		});
	}
	//弹出设置层
	function lead(itemid,b){
		$.get("__MODULE__/Lead/lead_list/itemid/"+itemid, function(d){
			if (d.status==1) {
				open_l(itemid,d.info);
			}else{
				layer.open({
				    content: d.info
				});  
			}
		});
	}
	function sub(a){
		var itemid = $('input[name="itemid"]');
		var manage_money = $('input[name="manage_money"]');
		var num = $('input[name="num"]');
		var do_what = $('textarea[name="do_what"]');
		if(manage_money.val()=='' || isNaN(manage_money.val())){
			layer.tips("纯数字填写","#manage_money",{
			    tips: 1
			})
			manage_money.focus();
			return false
		}
		if(num.val()=='' || isNaN(num.val())){
			layer.tips("纯数字填写","#num",{
			    tips: 1
			})
			num.focus();
			return false
		}
		if(do_what.val()==''){
			layer.tips("不能为空","#do_what",{
			    tips: 1
			})
			do_what.focus();
			return false
		}
		$.post("__MODULE__/Lead/sub_lead", {
		 	itemid: itemid.val(),
		 	manage_money: manage_money.val(),
		 	num: num.val(),
		 	do_what: do_what.val(),
		},function(d){
			if (d.status == 1) {
				layer.open({
				    content: d.info,
				    yes: function(index){
				    	layer.close(index); //一般设定yes回调，必须进行手工关闭
				    	window.location.reload();
				    }
				}); 
			}else{
				alert(d.info);
			}
	   	});
	}
	function video(url){
		layer.open({
        type: 2,
        title: '提示',
        shadeClose: true,
        shade: 0.8,
        area: ['1000px', '570px'],
        content: url
      });
	}
</script>
</body>
</html>